warshall's algorithm in discrete math